<!--********************************************************************
* Copyright© 2000 - 2019 SuperMap Software Co.Ltd. All rights reserved.
*********************************************************************-->
<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title data-i18n="resources.title_layerService"></title>
    <script type="text/javascript" include="bootstrap-css" src="./js/include-web.js"></script>
    <script type="text/javascript" src="./openlayers/include-openlayers.js"></script>
    <style>
    	html,body{
    		position: relative;
    		width: 100%;
    		height: 100%;
    	}
    </style>
</head>
<body style=" margin: 0;overflow: hidden;background: rgb(4, 15, 45);width: 100%;height:100%">
<div id="map" style="width: 100%;height:100%" ></div>
<div id="popup" class="ol-popup">
    <div id="popup-content"></div>
</div>
<script type="text/javascript">
	function getParam(){
	var url = window.location.search;
	var theRequest = new Object();  
	if(url.indexOf("?") != -1) {  
		var str = url.substr(1); //substr()方法返回从参数值开始到结束的字符串；  
		var strs = str.split("&");  
		for(var i = 0; i < strs.length; i++) {  
		   theRequest[strs[i].split("=")[0]] = decodeURI(strs[i].split("=")[1]);  
		}  
	}
	return theRequest;
}
	var testone = 'hello'
// var map, url = "http://113.0.63.5:8090/iserver/services/map-chengshiweij/rest/maps/chengshiweij";
	var map, url=getParam().url, x=getParam().x, y=getParam().y, zoomsize=getParam().zoomsize;
	
    
//    console.log('search===>', window.location.search.split('=')[1])
//	console.log('url===>',window.location.href)
//	console.log(x,y,zoomsize)
    
    map = new ol.Map({
        target: 'map',
        /*controls: ol.control.defaults({attributionOptions: {collapsed: false}})
            .extend([new ol.supermap.control.Logo()]),*/
        view: new ol.View({
            center: [x,y],
            zoom: zoomsize,
            projection: 'EPSG:3857'
        })
    });
    var layer = new ol.layer.Tile({
        source: new ol.source.TileSuperMapRest({
            url: url,
            wrapX: true
        }),
        projection: 'EPSG:3857'
    });
    map.addLayer(layer);
    
</script>
</body>
</html>
